home *** CD-ROM | disk | FTP | other *** search
- on exitFrame
- global LastChannel, LastChannel, NumChannel, GfxChannel, SeqChannel, DVidChannel, CurtainChannel, first, AllScreen, CurrScreenID, ShowProgress1, rollList, clickList, ActList, ScreenCast, ScreenLinks, AddScreeb, ShowProgress1, NewScreenID, offList, OverChannel, BaseChannel, athsndflag, stasndflag, NumActive, EndChannel, NumChannels
- if NewScreenID then
- if first then
- set first to 0
- repeat with J = BaseChannel to LastChannel
- puppetSprite(J, 1)
- end repeat
- puppetSprite(OverChannel, 1)
- puppetSprite(GfxChannel, 1)
- puppetSprite(SeqChannel, 1)
- puppetSprite(DVidChannel, 1)
- puppetSprite(CurtainChannel, 1)
- end if
- set ScreenInfo to getAt(AllScreen, NewScreenID)
- set CurrScreenID to NewScreenID
- set NewScreenID to 0
- set ChangePalette to 0
- if ScreenCast <> -1 then
- set PalA to the palette of cast ScreenCast
- else
- set ChangePalette to 1
- end if
- set ScreenCast to getAt(ScreenInfo, 1)
- if ScreenCast <> -1 then
- set PalB to the palette of cast ScreenCast
- end if
- if PalA <> PalB then
- set ChangePalette to 1
- end if
- if ChangePalette then
- puppetPalette("Black", 27)
- end if
- puppetSprite(BaseChannel, 1)
- set the castNum of sprite BaseChannel to ScreenCast
- puppetSprite(CurtainChannel, 1)
- set the castNum of sprite CurtainChannel to ScreenCast
- updateStage()
- if ChangePalette then
- puppetPalette(PalB, 27)
- end if
- set ScreenLinks to [getAt(ScreenInfo, 2)]
- append(ScreenLinks, getAt(ScreenInfo, 3))
- append(ScreenLinks, getAt(ScreenInfo, 4))
- NavSprites(ScreenLinks)
- set offList to []
- set rollList to []
- set clickList to []
- set ActList to []
- set CurrChannel to BaseChannel + 1
- set NumActive to 0
- repeat with Element in ScreenInfo
- if listp(Element) then
- set NumActive to NumActive + 1
- append(offList, getAt(Element, 1))
- set ActID to count(Element)
- if ActID = 2 then
- set RollID to 1
- set ClickID to 1
- else
- if ActID = 3 then
- set RollID to 2
- set ClickID to 2
- else
- if ActID = 4 then
- set RollID to 2
- set ClickID to 3
- end if
- end if
- end if
- append(rollList, getAt(Element, RollID))
- append(clickList, getAt(Element, ClickID))
- append(ActList, getAt(Element, ActID))
- puppetSprite(CurrChannel, 1)
- set the castNum of sprite CurrChannel to getAt(Element, 1)
- set CurrChannel to CurrChannel + 1
- end if
- end repeat
- repeat with J = NumActive + 1 to NumChannels
- puppetSprite(CurrChannel, 1)
- set the castNum of sprite CurrChannel to 3
- set CurrChannel to CurrChannel + 1
- end repeat
- ResetRoll()
- resetGfx()
- resetSeq()
- resetVideo()
- set the castNum of sprite CurtainChannel to 3
- end if
- set c to the mouseCast
- if (c >= 5) and (c <= 7) then
- if c = 7 then
- cursor([22, 23])
- if the mouseDown then
- set NewScreenID to getAt(ScreenLinks, 3)
- end if
- else
- if c = 5 then
- cursor([20, 21])
- if the mouseDown then
- set NewScreenID to getAt(ScreenLinks, 1)
- end if
- else
- cursor([24, 25])
- if the mouseDown then
- set NewScreenID to getAt(ScreenLinks, 2)
- end if
- end if
- end if
- else
- set ActiveChannel to 0
- set StdCursor to 1
- set rollAt to getPos(rollList, c)
- if rollAt then
- set ActiveChannel to rollAt + BaseChannel
- if soundBusy(1) then
- put "busy"
- go(the frame)
- exit
- end if
- if the mouseDown then
- cursor(200)
- set the castNum of sprite OverChannel to getAt(clickList, rollAt)
- updateStage()
- repeat while the mouseDown
- end repeat
- cursor(0)
- decode(getAt(ActList, rollAt))
- if (the castNum of sprite 25 = 121) and (athsndflag = 0) then
- set athsndflag to 1
- set stasndflag to 0
- puppetSound(2, 141)
- updateStage()
- end if
- if (the castNum of sprite 25 = 123) and (stasndflag = 0) then
- puppetSound(2, 142)
- set stasndflag to 1
- set athsndflag to 0
- updateStage()
- end if
- repeat while rollOver(25)
- nothing()
- end repeat
- end if
- else
- set offAt to getPos(offList, c)
- if offAt then
- set ActiveChannel to offAt + BaseChannel
- puppetSprite(ActiveChannel, 1)
- set the castNum of sprite OverChannel to getAt(rollList, offAt)
- end if
- end if
- if ActiveChannel then
- set StdCursor to 0
- if not soundBusy(1) then
- cursor([28, 29])
- end if
- else
- set the castNum of sprite OverChannel to 3
- end if
- if StdCursor then
- cursor(0)
- end if
- end if
- if NewScreenID then
- put "Going to " & NewScreenID
- repeat while the mouseDown
- end repeat
- end if
- go(the frame)
- end
-
- on NavSprites ScreenLinks
- repeat with J = 1 to 3
- set ch to 44 + J
- puppetSprite(ch, 1)
- if getAt(ScreenLinks, J) then
- set the visible of sprite ch to 1
- next repeat
- end if
- set the visible of sprite ch to 0
- end repeat
- end
-